 /**
 * @file tkl_rf_data_transceiver.h
 * @brief Common process - raw data transceiver
 * @version 1.0.0
 * @date 2021-04-30
 *
 * @copyright Copyright 2018-2021 Tuya Inc. All Rights Reserved.
 *
 */

 /*****************************************************************************
  * @Describe: RF API not not allowed to call in the joined network state.
  * 
 ******************************************************************************/


#ifndef __TKL_RF_DATA_TRANSCEIVER_H__
#define __TKL_RF_DATA_TRANSCEIVER_H__


#ifdef __cplusplus
    extern "C" {
#endif

#include "tuya_cloud_types.h"

/*
 *  RF raw data receive callback
*/
typedef VOID_T (*TKL_RF_RECV_CB)(UINT8_T *packet, UINT8_T lqi, INT8_T rssi);

/**
 * @brief RF raw data transmission channel setting
 *
 * @param[in] channel: RF channel
 * @return  TRUE: success  FALSE: fail
 */
BOOL_T tkl_rf_channel_set(UINT8_T channel);

/**
 * @brief RF raw data transmission channel get
 *
 * @param[in] channel: RF channel
 * @return  channel
 */
UINT8_T tkl_rf_channel_get(VOID_T);


/**
 * @brief RF raw data transmit power setting
 *
 * @param[in] power: RF power
 * @return  TRUE: success  FALSE: fail
 */
BOOL_T tkl_rf_tx_power_set(INT8_T power);

/**
 * @brief RF raw data transmission start
 *
 * @param[in] recv_cb: data receive callback
 * @return  TRUE: success  FALSE: fail
 */
BOOL_T tkl_rf_transeiver_start(TKL_RF_RECV_CB recv_cb);

/**
 * @brief RF raw data transmission stop
 *
 * @param[in] none
 * @return  TRUE: success  FALSE: fail
 */
BOOL_T tkl_rf_transeiver_end(VOID_T);

/**
 * @brief RF raw data send 
 * 
 * @param[in] packet: point to data to be sent
 * @return  TRUE: success  FALSE: fail
 */
BOOL_T tkl_rf_data_send(UINT8_T *packet);


#ifdef __cplusplus
}
#endif

#endif



